<button class="btn btn-info" type="button" onclick="backtoMain()">返回</button><br>
<table class="table" id="pomainDiv">
    <thead>
    <tr>
        <th>产品编号</th>
        <th>产品名称</th>
        <th>产品库存</th>
    </tr>
    </thead>
    <tbody id="tableBody"></tbody>
</table>


<script id="productItemReportTemplate" type="text/html">
    {{each data value index}}
    <tr>
        <td>{{value.productCode}}</td>
        <td>{{value.name}}</td>
        <td>{{value.num}}</td>
    </tr>
    {{/each}}
</script>

<script>
    $(function () {
        Ajax.post(
            "/selectProductReport",
            {date:sessionStorage.getItem("productdate")},
            function (result) {
                var div=document.getElementById("tableBody")
                var html=template('productItemReportTemplate',{data:result.data})
                div.innerHTML=html
            }
        )
    })
    function backtoMain() {
        sessionStorage.setItem("backproductdate",sessionStorage.getItem("productdate"))
        show("/report/productReport.html")
    }
</script>
